<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #chart {
      width: 400px;
      height: 400px;
    }
  </style>
  <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.0.0/echarts.min.js"></script>
</head>

<body>
  <div id="chart"></div>
  <script>
    const chartDOM = document.getElementById("chart")
    const chart = echarts.init(chartDOM, 'dark')
    chart.setOption({
      title: {
        text: 'dataset'
      },
      xAxis: {
        data: ['一季度', '二季度', '三季度', '四季度']
      },
      dataset: {
        source: [
          ['一季度', 100, 79, '分类1', 50],
          ['二季度', 120, 81, '分类2', 55],
          ['三季度', 90, 72, '分类3', 65],
          ['四季度', 150, 101, '分类4', 75],
        ]
      },
      yAxis: {},
      series: [
        {
          type: 'pie', // 饼图
          /* data: [
            { name: '分类 1', value: 50 },
            { name: '分类 2', value: 55 },
            { name: '分类 3', value: 65 },
            { name: '分类 4', value: 75}
          ], */
          encode: { itemName: 3, value: 4 },
          center: ['50%', 60],
          radius: 35,
        },
        {
          type: 'line', // 折线图
          // data: [100, 120, 90, 150]
          encode: { x: 0, y: 1 }
        },
        {
          type: 'bar', // 柱状图
          // data: [79, 81, 72, 101]
          encode: { x: 0, y: 2 }
        }
      ]
    })
  </script>
</body>

</html>